package com.itheima.web;

import com.itheima.service.UserService;

import java.io.IOException;

@javax.servlet.annotation.WebServlet(urlPatterns = "/FindAllServlet")
public class FindAllServlet extends javax.servlet.http.HttpServlet {
    protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {
        //1.接收请求
        //2.业务处理
        UserService service = new UserService();
           String json = service.fiandAllUser();
        //3.响应数据
        response.setContentType("text/html;charset=utf-8");
        response.getWriter().print(json);

    }

    protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {
        doPost(request, response);
    }
}
